package com.cloudnews;

import java.io.Serializable;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Model;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.jboss.seam.faces.environment.FacesContextProducer;
import org.jboss.seam.international.status.Messages;

@Named("signUpHome")
@RequestScoped
@Model
public class SignUpHome implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ReporterAccount account = new ReporterAccount();
	
	@PersistenceContext
	private EntityManager em;
	
	@Inject
	private Messages messages;
	
	@Inject
	private FacesContext facesContext;
	
	public void register(){
		account.setEmail(account.getUsername());
		em.persist(account);
	}

	public ReporterAccount getAccount() {
		return account;
	}

	public void setAccount(ReporterAccount account) {
		this.account = account;
	}
	
}
